dojo.declare("DVendorOrderCurrentPg", wm.Page, {
    start: function() {
        //this.svVendorCurrentOrders.update();
        
    },
    "preferredDevice": "desktop",

    svUpdateOrderStatusSuccess1: function(inSender, inDeprecated) {
        this.svVendorCurrentOrders.clearData()
        this.lvOrderItems.clearData();
        this.svVendorCurrentOrders.update();
    },
    listVendorOrdersOrderIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        //order id
       var comment = '';
        var vendor_comment = '';
       
        if (rowObj.comment && rowObj.comment !== null) {
            comment = rowObj.comment;
        }
        if (rowObj.vendor_comment && rowObj.vendor_comment !== null) {
            vendor_comment = rowObj.vendor_comment;
        }
        var display = "<div class='MobileRowTitle'><b>Order#:</b> " + rowObj.orderId + "</div>" + "<div class='MobileRow'>" + wm.List.prototype.dateFormatter({
            "formatLength": "medium",
            "dateType": "date and time"
        }, null, null, null, rowObj.orderDt) + "</div>" + "<div class='MobileRow'>Customer Comments: " + comment + "</div>"+ "<div class='MobileRow'>Vendor Comments: " + vendor_comment + "</div>";
        return display;


    },
    listVendorOrdersCustomerNameFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var display = "<div class='MobileRow'><b>Customer Details: </b> </br>" + rowObj.customerName + "</br> Ph: " + rowObj.contactNum + "</br> Address : Block - " + rowObj.blockName + "</br> Door -" + rowObj.doorName + "</div>";
        return display;
    },
    listVendorOrdersStatusFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var display = "<div class='MobileRowTitle'><b>Status :</b> </br> " + rowObj.status + "</div>";
        return display;
    },
    listVendorOrdersPriceFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var display = "<div class='MobileRow'><b>TotalPrice: <b>" + rowObj.price + " Rs</div>";
        return display;
    },
    list2OrderItemIdFormat: function(inValue, rowId, cellId, cellField, cellObj, rowObj) {
        var comment = '';
        if (rowObj.comments != null) {
            comment = rowObj.comments;
        }
 var vendor_comment = '';
        if (rowObj.vendor_comment != null) {
            vendor_comment = rowObj.vendor_comment;
        }

        var display = "<div class='MobileRow'>Item Name: " + rowObj.items.itemName + "</div>" + "<div class='MobileRow'>Item Desc: " + rowObj.items.itemDesc + "</div>" + "<div class='MobileRowTitle'>Quantity: " + rowObj.quantity + "</div>" + "<div class='MobileRow'>Price: " + rowObj.price + " Rs</div>";// + "<div class='MobileRow'>Customer Comments: " + comment + "</div>";
        return display;
    },
    listVendorOrdersSelect1: function(inSender, inItem) {
        this.selectMenu1.setDataValue("Delivered");
        this.largeTextArea1.setDataValue("");
    },
    button2Click1: function(inSender) {
        this.svVendorCurrentOrders.clearData();

    },
    _end: 0
});